package com.hope.onlinestudy.activity.order

import android.support.v7.widget.LinearLayoutManager
import android.view.View
import com.hope.onlinestudy.R
import com.hope.onlinestudy.model.OrderModel
import com.hope.onlinestudy.mvp.MVPBaseActivity
import kotlinx.android.synthetic.main.activity_order.*
import kotlinx.android.synthetic.main.layout_recyclerview.*
import kotlinx.android.synthetic.main.view_title.*

/**
 * MVPPlugin
 * 邮箱 784787081@qq.com
 */
class OrderActivity : MVPBaseActivity<OrderContract.View, OrderPresenter>(), View.OnClickListener ,
    OrderContract.View {

    private val adapter: OrderAdapter<OrderModel> by lazy { OrderAdapter<OrderModel>() }

    override fun getLayoutView(): Int {
        return R.layout.activity_order
    }
    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.iv_backup -> finish()
//            R.id.tvObil -> adapter.setDataEntityList(model?.data?.get(0)?.offOrderList!!)
//            R.id.tvIsPay -> adapter.setDataEntityList(model?.data?.get(0)?.mentOrderList!!)
//            R.id.tvHistroy -> adapter.setDataEntityList(model?.data?.get(0)?.orderList!!)
        }
    }
    override fun initData() {
        tv_title.text = "我的订单"
        iv_backup.setOnClickListener(this)
        tvObil.setOnClickListener(this)
        tvIsPay.setOnClickListener(this)
        tvHistroy.setOnClickListener(this)

        rcvList.adapter = adapter
        rcvList.layoutManager = LinearLayoutManager(this)
    }
}